package cn.getech.data.development.mapper;

import cn.getech.data.development.dto.TableFieldDto;
import cn.getech.data.development.entity.TableFieldInfo;
import cn.getech.system.center.model.dto.RoleRowAndRoleDataPermissionDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 表字段信息 Mapper 接口
 * </p>
 *
 * @author zenith
 * @since 2019-07-08
 */
@Mapper
public interface TableFieldInfoMapper extends BaseMapper<TableFieldInfo> {

    List<TableFieldInfo> selectAllTavleFieldInfoByDbNameAndTableName(@Param("searchDbName") String dbname, @Param("searchDbNameSet") Set<String> searchDbNameSet);

    List<TableFieldDto> selectListByTableId(@Param("tableId") Integer tableId);

    List<TableFieldInfo> selectListByTableIds(@Param("tableIdSet")  Set<Integer> tableIds);

    void batchInserts(@Param("tableFieldInfos") List<TableFieldInfo> tableFieldInfos);

    List<RoleRowAndRoleDataPermissionDto> selectTableFileRuleIds(@Param("tableId") Integer tableId);

    List<TableFieldInfo> listAll();

}
